<template>
  <div class="second-table">
    <!-- <div class="second-table-header">
      <div class="title">{{ title }}</div>
      <div class="btns">
        <slot name="daochu"> </slot>
      </div>
    </div> -->
    <slot name="table"></slot>
    <div class="second-table-footer">
      <!-- <span class="count">共计 {{ total }} 条</span> -->
      <div
        :class="[
          'footers',
          { 'flex-end': !$slots.footer, 'justify-between': $slots.footer },
        ]"
      >
        <slot name="footer"></slot>
        <el-pagination
          class="pagination"
          background=""
          layout="prev, pager, next,total,jumper"
          :current-page.sync="thisCurrent"
          :total="total"
          @current-change="handleCurrentChange"
          :page-size="size"
        >
          <!-- page-size每页显示多少条数据 -->
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    title: String,
    total: Number,
    current: Number,
    size: {
      type: Number,
    },
  },
  data() {
    return {
      thisCurrent: this.current,
    };
  },
  watch: {
    current(val) {
      if (this.thisCurrent !== val) {
        this.thisCurrent = val;
      }
    },
    thisCurrent() {
      this.$emit("update:current", this.thisCurrent);
    },
  },
  mounted() {
    // document.getElementsByClassName(
    //   'el-pagination__jump'
    // )[0].childNodes[0].nodeValue = '到'
    // this.handleCurrentChange()
  },
  methods: {
    handleCurrentChange() {
      this.$emit("changePage", {
        page: this.thisCurrent,
        pageSize: this.size,
      });
    },
  },
};
</script>
<style lang="scss" scoped>
@import "../../styles//element-variables.scss";
::v-deep .el-pagination.is-background .el-pager li:not(.disabled):hover {
  color: #fff;
}
.second-table-footer {
  position: relative;
  justify-content: center !important;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  color: #333;
  background-color: #ededed;
}
::-webkit-scrollbar-thumb {
  background-color: #fff;
  border-radius: 3px;
}
.second-table-footer {
  width: 100%;
  //   height: 0.15625rem;
  display: flex;
  align-content: center;
  justify-content: center;
  position: relative;
  // bottom: 40px;
  margin-top: 30px;
}
.page-body-column2-content {
  height: 815px !important;
}

.el-table .el-table__body-wrapper tr {
  height: 50px !important;
}
.el-table__empty-text {
  color: #fff !important;
  font-size: 24px;
  letter-spacing: 5px;
}
.el-table::before {
  height: 0;
}
.second-table {
  padding-bottom: 20px;
  &-header {
    width: 100%;
    height: 36px;
    display: flex;
    align-content: center;
    justify-content: center;
    margin-bottom: 22px;
    .title {
      height: 36px;
      line-height: 36px;
      font-size: 20px;
      font-family: SourceHanSansSC;
      font-weight: bold;
      color: #fff;
    }
    .btns {
      .el-button {
        width: 68px;
        height: 36px;
        background: #fff;
        border: 0;
        border-radius: 0;
        font-size: 16px;
        font-family: SourceHanSansSC;
        font-weight: 400;
        color: #010a31;
      }
    }
  }
  .el-table {
    // 有下拉内容的列
    .tr-drop {
      .tr-drop-title {
        width: 300px;
        height: 18px;
        line-height: 18px;
        font-size: 18px;
        margin-bottom: 8px;
        font-family: SourceHanSansSC;
        font-weight: bold;
        color: $--color-primary;
      }
      .tr-drop-imgs {
        .el-image {
          width: 200px;
          height: 150px;
          margin-bottom: 20px;
          margin-right: 20px;
        }
      }
      .tr-drop-value {
        display: inline-block;
        font-size: 18px;
        font-family: SourceHanSansSC;
        font-weight: bold;
        color: $--color-primary;
        &-error {
          color: #fe6376;
        }
      }
    }
    .tr-drop-inline {
      .tr-drop-title {
        display: inline-block;
      }
    }
    // 操作
    .show-more {
      cursor: pointer;
    }
  }
  &-footer {
    width: 100%;
    // height: 4px;
    display: flex;
    align-content: center;
    justify-content: space-between;
    // margin-bottom: 20px;
    .count {
      height: 30px;
      line-height: 30px;
      font-size: 17px;
      font-weight: 400;
      color: #333;
      padding-left: 30px;
      box-sizing: border-box;
    }
  }
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  background: unset;
  border: 1px solid $--color-primary;
  color: $--color-primary;
}
.footers {
  width: 100%;
  display: flex;
}
.flex-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
  align-items: center;
}
</style>
